package com.estasenposse.tdam.services;

import android.app.IntentService;
import android.content.Intent;
import android.os.Handler;
import android.util.Log;

import com.estasenposse.tdam.RSS.RssReader;

public class OnHandlerIntent extends IntentService {
	
    public OnHandlerIntent() {		
        super("OnHandlerIntent");
    }
    
	@Override
	protected void onHandleIntent(Intent intent) {
		try {
		 Handler mHandler = new Handler(getMainLooper());
		    mHandler.post(new Runnable() {
		        @Override
		        public void run() {
		        	try {	
		    			Class.forName("android.os.AsyncTask"); 
		    			RssReader rss;
		    			rss = new RssReader(null, getApplicationContext());
		    			rss.execute();
		    		} catch (Exception e) {
		    			Log.i("OnHandlerIntentException",e.getMessage());
		    			e.printStackTrace();
		    		}
		        }
		    });
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
}
